package com.zcoj.service;

import com.zcoj.core.model.PageData;
import com.zcoj.core.model.PageWrap;
import com.zcoj.pojo.Dto.GroupProblem;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

@CacheConfig(cacheNames ="ProblemVoService")
public interface GroupProblemService {

    /**
     * 创建
     * @author 剩xia的盛夏
     * @date 2023/02/24 16:16
     */
    @CacheEvict(value = "ProblemVoService",allEntries = true)
    Integer create(GroupProblem groupProblem);

    /**
     * 主键删除
     * @author 剩xia的盛夏
     * @date 2023/02/24 16:16
     */

    @CacheEvict(value = "ProblemVoService",allEntries = true)
    void deleteById(Integer id);

    /**
     * 批量主键删除
     * @author 剩xia的盛夏
     * @date 2023/02/24 16:16
     */

    @CacheEvict(value = "ProblemVoService",allEntries = true)
    void deleteByIdInBatch(List<Integer> ids);

    /**
     * 主键更新
     * @author 剩xia的盛夏
     * @date 2023/02/24 16:16
     */

    @CacheEvict(value = "ProblemVoService",allEntries = true)
    void updateById(GroupProblem groupProblem);

    /**
     * 批量主键更新
     * @author 剩xia的盛夏
     * @date 2023/02/24 16:16
     */

    @CacheEvict(value = "ProblemVoService",allEntries = true)
    void updateByIdInBatch(List<GroupProblem> groupProblemList);

    /**
     * 主键查询
     * @author 剩xia的盛夏
     * @date 2023/02/24 16:16
     */
    @Cacheable(key = "#p0.toString()+'GroupProblemfindById'")
    GroupProblem findById(Integer id);

    /**
     * 条件查询单条记录
     * @author 剩xia的盛夏
     * @date 2023/02/24 16:16
     */

    @Cacheable(key = "#p0.toString()+'GroupProblemfindOne'")
    GroupProblem findOne(GroupProblem groupProblem);

    /**
     * 条件查询
     * @author 剩xia的盛夏
     * @date 2023/02/24 16:16
     */

    @Cacheable(key = "#p0.toString()+'GroupProblemfindList'")
    List<GroupProblem> findList(GroupProblem groupProblem);

    /**
     * 分页查询
     * @author 剩xia的盛夏
     * @date 2023/02/24 16:16
     */

    @Cacheable(key = "#p0.toString()+'GroupProblemfindPage'")
    PageData<GroupProblem> findPage(PageWrap<GroupProblem> pageWrap);

    /**
     * 条件统计
     * @author 剩xia的盛夏
     * @date 2023/02/24 16:16
     */
    long count(GroupProblem groupProblem);
}
